<?php

require_once 'utility.php';
require_once 'mysql/dbHelper.php';

$comments = $_POST['feedbackTextField'];
$user = $_POST['user'];
$email = getEmailFromUsername($user);
$url = $_SERVER['HTTP_REFERER'];
$subject = "METOC space portfolio feedback request";
$message = "user: \t$user ($email)\n\nComments: \t$comments \n\nurl:\t $url \n\n";

//echo "$subject <br><br> $message";
if(sendWebmasterMessage($subject, $message)){
    header("location:$url&update=Email successfully sent");
}
else{
    echo "Failed to send message";
}

